package com.example.vertification.service;

import com.example.vertification.Utils.RedisUtil;
import com.example.vertification.entity.User;
import com.example.vertification.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

@Service
public class RegisterCodeService {

    @Autowired
    private RedisUtil redisUtil;


    public void setCodeWithBoundIP(String IP,String Code){
        redisUtil.setIpCaptchaCooldown(IP,Code,60, TimeUnit.SECONDS);
    }

    public String getCodeByIP(String IP){
       return  redisUtil.getIpCaptcha(IP);
    }




}